{% extends "adibilisadminBundle::layout.html.twig" %}
 
{% block title %}
  Actualités - {{ parent() }}
{% endblock %}

{% block adibilisadmin_body %}

{% if app.session.hasFlash('info') %}
        <div class="alert alert-success">
            {{ app.session.flash('info') }}
        </div>
{% endif %}



</br>

<!--

<h1>Articles</h1> <hr />

    {% for entity in entities %}
<h2>
<a href="{{ path('article_show', { 'id': entity.id }) }}"> {{ entity.title }} </a>
</h2>

<i>
Le {{ entity.date|date('d/m/Y à H:i:s') }} , par {{ entity.author.username }}.
</i>
    <div class="well">
      {{ entity.content | raw }}
    </div>
    <hr />



    {% endfor %}

-->
        <section class="section-page-header">
            <div class="container">
                <div class="row">
                    <div class="span12">
                        <div class="page-header">
                            <h4>— {{ 'article.index.title'|trans }} —</h4>
                        </div>
                    </div>
                </div>
                <img src="/adibilis/web/img/round/divider_shadow.png" title="" alt="">
            </div>
        </section> 
     <!-- Start Blog -->                                              
        <section class="blog">
            <div class="container">
                <div class="row">
                    <div class="span8">


                      {% for entity in entities %}


                        <article>
                            <div class="row">
                                <div class="span1">                                    
                                    <div class="post-date">
                                       <!-- <div class="day">{{ entity.date|date('d') }}</div> -->
                                        <div class="month">{{ entity.date| localizeddate('medium', 'none', 'en') }}</div>
                                    </div>                                   
                                </div>
                                <div class="span7">
                                    {% if  entity.image!= null %}
                                    <div class="img-polaroid">
                                         <a href="{{ path('article_show', { 'id': entity.id }) }}"><center><img src="/adibilis/web/uploads/img/articles/{{ entity.image.id }}.{{ entity.image.url }}" /></center></a> 
                                    </div> 
                                    {% endif %}                                     
                                    <h3 class="blog-title"><a href="{{ path('article_show', { 'id': entity.id }) }}">

                                      

                                      {% if app.request.locale == 'fr' %}
                                            {{ entity.title }}  </br>
                                      {% endif %}


                                      {% if app.request.locale == 'en' %}
                                            {{ entity.titleen }}  </br>
                                      {% endif %}


                                      {% if app.request.locale == 'de' %}
                                            {{ entity.titlede }} </br>
                                      {% endif %}



                                    </a></h3>   
                                    <div class="article_meta">
                                 <ul class="meta-list">
                                   <li><a href=""><span class="icon-user"></span>{{ entity.author.username }}</a></li>
                                  <!-- <li><a href=""><span class="icon-comments"></span> 10 commentaire(s)</a></li>-->
                                   </ul>
                               </div>
                                    

                                {% if app.request.locale == 'fr' %}
                                      {% set content = entity.content | truncate(200, true, '...')  %}
                                {% endif %}


                                {% if app.request.locale == 'en' %}
                                      {% set content = entity.contenten | truncate(200, true, '...')  %}
                                {% endif %}


                                {% if app.request.locale == 'de' %}
                                      {% set content = entity.contentde | truncate(200, true, '...')  %}
                                {% endif %}

                               {{ content | raw  }}
                                    <p><a href="{{ path('article_show', { 'id': entity.id }) }}" class="btn btn-success">{{ 'article.index.read_more'|trans }} <i class="icon-circle-arrow-right"></i></a></p>                      
                                </div>
                            </div>
                        </article>   
                        <hr>

                        {% endfor %}


                        <div class="pagination"> <ul>

                          {% for p in range(1, nombrePage) %}
                          <li{% if p == page %} class="active"{% endif %}>
                          <a href="{{ path('article', {'page': p}) }}">{{ p
                          }}</a>
                          </li>
                          {% endfor %} </ul>
                        </div>




                        {% if is_granted('ROLE_ADMIN') %}
                        </br>
                        </br>
                        <a href="{{ path('article_new') }}" class="btn">
                              <i class="icon-plus"></i>
                              Ajouter un article
                            </a>
                        {% endif %}
               
                    </div>
          
          
                    <div class="span4 sidebar">
                        <div class="widget recent-post">
                            <div class="divider1"><h5>{{ 'article.index.recent'|trans }}</h5></div>
                            <ul>
                               {% render "adibilisadminBundle:Article:lastnews" with {nombre: 5} %}
                            </ul>
                        </div>

            
                    </div>
                </div>     
            </div>
        </section>     
        <!-- End blog -->   










{% endblock %}
